<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<div id="warp">
	<div id="warp-inner">
		<div id="photos">
			<logic:present name="images"> 
				<table>
					
<%-- 					<p>from <bean:write name="from"/> to <bean:write name="to"/></p> --%>
					
					<tbody>
						<%!int i=0; %>
						<logic:iterate id="img" name="images" scope="request" >
						<%if ((i%2)==0) out.print("<tr>");%>
							
								<td>
									<a href="<bean:write name='img' property='imgRef' />" target="_blank">
										<img 	width="<bean:write name='img' property='width' />" 
												height="<bean:write name='img' property='height' />"
												alt='<bean:message key="image.alt"/>' 
												src="<bean:write name='img' property='imgThumbnail'/>"
										/>
									</a>
								</td>
								
						<%if ((i%2)==1) out.print("</tr>"); %>
						<%i++; %>
						</logic:iterate>
					</tbody>
	
				</table>
			</logic:present>

		</div>

<!-- 		<div id="main"> -->
<!-- 			<div class="top"> -->

<!-- 				<span class="title"> <span class="word" id="text2"><font -->
<!-- 						size="2px">null &nbsp;</font></span> -->

<!-- 				</span> <span class="plural">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> -->
<!-- 				<span class="spell"><font size="2px"> </font> </span> -->
<!-- 			</div> -->
<!-- 		</div> -->

		<div id="main">
			<logic:present name="idioma"> 
			<div class="top">
				<span class="title">
					<span class="word"><font size="2px"><bean:write name="idioma" property="genero"/></font> <bean:write name="idioma" property="nombre"/></span>
					<audio id="player" src="<bean:write name='idioma' property='cod_audio'/>"> </audio>
					<a id="button" title="button"> 
						<div class="listen"> </div> 
					</a>
				</span> 
				<span class="spell">
					<logic:present  name="pronunciacion" scope="request">
						<bean:write name="pronunciacion" scope="request"/> 
					</logic:present>
				</span>
				<span class="conjugate">
					<logic:present name="idioma" property="verbo">
						<a href='<bean:write name="conjugate" scope="request"/>'
							target=_blank>
							conjugate
						</a>
					</logic:present>
				</span>
			</div>
			</logic:present>
			<logic:present name="definicion"> 
			<ul>
				<logic:present name="definicion" property="definicion_1"> 
					<li>
						<span class="number">1.</span>
						<bean:write name="definicion" property="definicion_1"/>
						<span class="frase"><bean:write name="definicion" property="ejemplo_1"/></span>
					</li>
				</logic:present>
				<logic:present name="definicion" property="definicion_2">
					<li>
						<span class="number">2.</span>
						<bean:write name="definicion" property="definicion_2"/>
						<span class="frase"><bean:write name="definicion" property="ejemplo_2"/></span>
					</li>
				</logic:present>
				<logic:present name="definicion" property="definicion_3">
					<li>
						<span class="number">3.</span>
						<bean:write name="definicion" property="definicion_3"/>
						<span class="frase"><bean:write name="definicion" property="ejemplo_3"/></span>
					</li>
				</logic:present>
			</ul>
			<a href="<bean:write name='enlace' scope='request'/>" target="_blank"><div class="moreinfo"></div></a>
			</logic:present>
			
			<logic:notPresent name="idioma">
				<logic:notPresent parameter="query" scope="request">
					<bean:message key="word.message"/>
				</logic:notPresent>
				
				<logic:present parameter="query" scope="request">
					<bean:message key="word.message.no.found"/>
				</logic:present>
			</logic:notPresent>
		</div>
		
		
		<script
			src="http://www.google.com/jsapi?key=AIzaSyA5m1Nc8ws2BbmPRwKu5gFradvD_hgq6G0"
			type="text/javascript"></script>
		<script type="text/javascript">
			/*
			 *  How to translate text.
			 */

			google.load("language", "1");

			function initialize() {
				var content = document.getElementById('content');
				var from = document.getElementById('from2').value;
				var to = document.getElementById('to2').value;
				// Setting the text in the div.

				// Grabbing the text to translate
				var text = document.getElementById("text2").innerHTML;
				// Translate from Spanish to English, and have the callback of the request
				// put the resulting translation in the "translation" div.
				// Note: by putting in an empty string for the source language ('es') then the translation
				// will auto-detect the source language.
				google.language.translate(text, from, to, function(result) {
					var translated = document.getElementById("translation");
					if (result.translation) {
						translated.innerHTML = result.translation;
					}
				});
			}
			google.setOnLoadCallback(initialize);
			google.language.getBranding('branding');
		</script>
		<div id="ad">
			<div class="ad-inner">
				<div class="ad-padd">
					<script type="text/javascript">
					<!--
						google_ad_client = "pub-4347470857342006";
						/* Augusto_2_160x600_20/09/10 */
						google_ad_slot = "9915238730";
						google_ad_width = 160;
						google_ad_height = 600;
					//-->
					</script>
					<script type="text/javascript"
						src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
						
					</script>
				</div>
			</div>
		</div>
	</div>
</div>

